package com.qidi.controller;

import com.qidi.bean.Department;
import com.qidi.bean.Msg;
import com.qidi.bean.User;
import com.qidi.service.impl.DepartmentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

/**
 * @author zhouXinBin
 * @create 2020-10-26-19:20
 */
@Controller
public class DepartmentController {
    @Autowired
    private DepartmentService departmentService;

    @RequestMapping("/depts")
    @ResponseBody
    public Msg getDepts(){
        List<Department> list=departmentService.getAllDepts();
        return Msg.success().add("depts",list);
    }

}
